//
//  DateModel.m
//  carcareIOS
//
//  Created by ileo on 16/4/12.
//  Copyright © 2016年 chezheng. All rights reserved.
//

#import "DateModel.h"
#import "CalendarMgr.h"

@implementation DateModel

-(NSString *)dateStr{
    if (!_dateStr) {
        NSInteger year = self.year != 0 ? self.year : 1970;
        NSInteger month = self.month != 0 ? self.month : 1;
        NSInteger day = self.day != 0 ? self.day : 1;
        _dateStr = [NSString stringWithFormat:@"%zd-%02zd-%02zd",year,month,day];
    }
    return _dateStr;
}

-(NSDate *)date{
    if (!_date) {
        _date = [CALENDARMGR dateWithStr:self.dateStr format:yyyy_MM_dd];
    }
    return _date;
}


@end
